package com.example.bootrabbitmq.api;

import com.example.bootrabbitmq.direct.DirectRabbitProducer;
import com.example.bootrabbitmq.restful.ResultVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api")
public class TestApi {

    @Autowired
    private DirectRabbitProducer directRabbitProducer;

    @GetMapping("/send")
    public ResultVO<String>  testSendMsg(@RequestParam String msg){
        directRabbitProducer.sendMsg(msg);
        return ResultVO.ok("1");
    }

}
